<body>
    <form action="/user/register" method="post">
        <input type="text" name="username" placeholder="请输入用户名">
        <input type="password" name="password" placeholder="请输入密码">
        <input type="password" name="cofrim" placeholder="请确认密码">
        <input type="text" name="nickname" placeholder="请输入昵称">
        <img src="/user/captcha" alt=""><input type="text" name="captcha" placeholder="请输入验证码">
        <input type="submit" value="注册">

    </form>
    <h1>
    //服务器端返回msg数据
        <%= msg %>
    </h1>
    <script>
    //点击图片刷新验证码
        let img = document.querySelector('img')
        img.onclick = function() {
            this.src = '/user/captcha?' + Math.random()
        }
    </script>
</body>
